.menu-icons {
  margin-right: 16px;
  width: 16px;
  height: 16px;
}

#app {
  .main-container {
    min-height: 100%;
    transition: margin-left 0.28s;
    position: relative;
  }
  .vertical-layout {
    .main-container {
      margin-left: $sideBarWidth;
    }
  }
  .horizontal-layout {
    .main-container {
      margin-left: 0;
    }
  }

  .sidebar-container {
    transition: width 0.28s;
    // reset element-ui css
    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
    }

    .scrollbar-wrapper {
      overflow-x: hidden !important;
    }

    .el-scrollbar__bar.is-vertical {
      right: 0;
    }

    .el-scrollbar {
      height: 100%;
    }

    &.has-logo {
      .el-scrollbar {
        height: calc(100% - 50px);
      }
    }

    .is-horizontal {
      display: none;
    }

    a {
      display: inline-block;
      width: 100%;
      overflow: hidden;
    }

    /* .svg-icon {
      margin-right: 16px;
      width: 16px;
      height: 16px;
    }*/
    .el-menu--collapse {
      .svg-icon {
        margin-right: 0;
      }
    }

    .sub-el-icon {
      margin-right: 12px;
      margin-left: -2px;
    }

    .el-menu {
      border: none;
      height: 100%;
      //width: 100% !important;
    }

    // menu hover
    .sub-menu-title-noDropdown,
    .el-sub-menu__title {
      &:hover {
        background-color: $menuHover !important;
      }
    }

    .is-active > .el-sub-menu__title {
      color: $subMenuActiveText !important;
    }

    & .nest-menu .el-sub-menu>.el-sub-menu__title,
    //.el-menu .el-menu--inline .el-sub-menu__title,
    & .el-sub-menu .el-menu-item {
      min-width: $sideBarWidth !important;
      background-color: $subMenuBg !important;

      &:hover {
        background-color: $subMenuHover !important;
      }
    }

    &.vertical {
      position: fixed;
      font-size: 0;
      z-index: 1001;
      overflow: hidden;
      left: 0;
      width: $sideBarWidth !important;
      background-color: $menuBg;
      height: 100%;
      top: 0;
      bottom: 0;
      .el-menu {
        width: 100% !important;
      }
    }
    &.horizontal {
      background-color: $menuBg;

      height: 50px;
      top: 0;
      right: 0;

      .el-menu {
        //width: 100% !important;
      }
    }
  }

  .hideSidebar {
    .sidebar-container {
      width: 54px !important;
      &.vertical {
        width: 54px !important;
      }
      &.horizontal {
        width: 100% !important;
      }
    }

    .horizontal-layout {
      .main-container {
        margin-left: 0;
      }
    }
    .main-container {
      margin-left: 54px;
    }

    .sub-menu-title-noDropdown {
      padding: 0 !important;
      position: relative;

      .el-tooltip {
        padding: 0 !important;

        .svg-icon {
          margin-left: 20px;
        }

        .sub-el-icon {
          margin-left: 19px;
        }
      }
    }

    .el-sub-menu {
      overflow: hidden;

      & > .el-sub-menu__title {
        padding: 0 !important;

        .svg-icon {
          margin-left: 20px;
        }

        .sub-el-icon {
          margin-left: 19px;
        }

        .el-sub-menu__icon-arrow {
          display: none;
        }
      }
    }

    .el-menu--collapse {
      .el-sub-menu {
        & > .el-sub-menu__title {
          & > span {
            height: 0;
            width: 0;
            overflow: hidden;
            visibility: hidden;
            display: inline-block;
          }
        }
      }
    }
  }

  .el-menu--collapse .el-menu .el-sub-menu {
    min-width: $sideBarWidth !important;
  }

  // mobile responsive
  .mobile {
    .main-container {
      margin-left: 0;
    }

    .sidebar-container {
      transition: transform 0.28s;
      &.vertical {
        width: $sideBarWidth !important;
      }
      &.horizontal {
      }
    }

    &.hideSidebar {
      .sidebar-container {
        transition-duration: 0.3s;
        &.vertical {
          pointer-events: none;
          transform: translate3d(-$sideBarWidth, 0, 0);
        }
        &.horizontal {
          transform: translate3d(0, 0, 0);
        }
      }
    }
  }

  .withoutAnimation {
    .main-container,
    .sidebar-container {
      transition: none;
    }
  }
}

// when menu collapsed
.el-menu--vertical {
  & > .el-menu {
    .svg-icon {
      margin-right: 16px;
    }
    .sub-el-icon {
      margin-right: 12px;
      margin-left: -2px;
    }
  }

  .nest-menu .el-sub-menu > .el-sub-menu__title,
  .el-menu-item {
    &:hover {
      // you can use $subMenuHover
      background-color: $menuHover !important;
    }
  }

  // the scroll bar appears when the subMenu is too long
  > .el-menu--popup {
    max-height: 100vh;
    overflow-y: auto;

    &::-webkit-scrollbar-track-piece {
      background: #d3dce6;
    }

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-thumb {
      background: #99a9bf;
      border-radius: 20px;
    }
  }
}
